﻿using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace XamlTests
{
    [TestClass]
    public class UserControlTest : XamlTestBase
    {
        [TestMethod]
        public void EventHandlerIsDetected()
        {
            var dependencies = (from x in Model.DependenciesPerMember where x.Key.FullName == "WpfControlLibrary1.UserControl1.§Void ButtonClick(System.Object, System.Windows.RoutedEventArgs)" select x).FirstOrDefault();
            var delegateReference = dependencies.Value.First();
            Assert.AreEqual(true, delegateReference.Source.IsGenerated);
            Assert.AreEqual("WpfControlLibrary1.UserControl1", delegateReference.Source.ImplementingType.FullName);
        }

    }
}
